package JAVACORE_TRAINING.OOPs.OOPs_EXCERCISES.LEVER01.EX06;

public class Models {

	public boolean CheckElement(NumberObject obj) {
		return (obj.getiNumber() % 2 == 0) ? true : false;
	}

	public void showNumber(NumberObject numberObject) {
		if (this.CheckElement(numberObject)) {
			System.out.println("The list includes of even number: ");
			for (int i = 0; i <= numberObject.getiNumber(); i++) {
				if (i % 2 == 0) {
					System.out.print(i + " ");
				}
			}
		} else {
			System.out.println("The list includes of odd number: ");
			for (int i = 1; i <= numberObject.getiNumber(); i++) {
				if (i % 2 != 0) {
					System.out.print(i + " ");
				}
			}
		}
	}
}
